﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using NamTrungBS.DataLayer;
namespace NamTrungBS
{
    public partial class ThongKe : Form
    {
        public ThongKe()
        {
            InitializeComponent();
            
        }



        private void btnThemHangMoi_Click(object sender, EventArgs e)
        {
            NewSanPham newsp= new NewSanPham();
            newsp.ShowDialog();
        }

        private void txtSoluong_TextChanged(object sender, EventArgs e)
        {
           
            if (txtSoluong.Text == "")
            {
                this.dataGridViewSP.DataSource = SanPhamDao.GetAllProduct1();

            }
            else
            {
                this.dataGridViewSP.DataSource = SanPhamDao.GetAllProductByCount(Int32.Parse(txtSoluong.Text));
            }
        }

        private void ThongKe_Load(object sender, EventArgs e)
        {
            txtSoluong.Focus();
        }
    }
}
